package com.example.demo.extra;

/**
 * @author long
 * @version 1.0.0
 * @ClassName PageRequest
 * @Description TODO
 * @createTime 2022.03.11 20:10
 */
public class PageRequest {

    private int pageNum = 1;
    private int pageSize = 10;
    private int offset = 0;

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getOffset() {
        return (this.pageNum - 1) * pageSize;
    }

    public void setOffset(int offset) {
        this.offset = offset;
    }

    public PageRequest() {
    }


    public PageRequest(int pageNum, int pageSize) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
    }
}
